package com.example.demo.controller;

import com.example.demo.entity.Device;
import com.example.demo.entity.User;
import com.example.demo.mapper.DeviceMapper;
import com.example.demo.mapper.UserMapper;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@Api(tags = "人员信息API")
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserMapper userMapper;

    @Autowired
    private DeviceMapper deviceMapper;

    @RequestMapping("/findAll")
    public List<User> findAll(){
        return userMapper.selectList(null);
    }

    @Autowired
    private UserMapper mapper;

    @RequestMapping("/findDeviceAll")
    public List<Device> findDeviceAll(){
        return deviceMapper.selectList(null);
    }
}
